package Calendar;


import java.util.Calendar;
import java.util.Date;

public class Test {
    public static void main(String[] args) {
        Calendar now = Calendar.getInstance();
        System.out.println(now);

        int year = now.get(Calendar.YEAR);
        System.out.println(year);

        int days = now.get(Calendar.DAY_OF_WEEK);
        System.out.println(days);

        //拿到日历中记录的日期对象
        Date d = now.getTime();
        System.out.println(d);

        //拿到时间毫秒
        long time = now.getTimeInMillis();
        System.out.println(time);

        //修改日历中的某个信息
        now.set(Calendar.MONTH,1);
        System.out.println(now.get(Calendar.MONTH) + "月");
        now.set(Calendar.DAY_OF_YEAR,125);
        System.out.println(now.get(Calendar.DAY_OF_YEAR));
    }
}
